import autoit
from selenium import webdriver

import time

from selenium.webdriver.common.by import By
# 1. 初始化浏览器，打开目标页面
driver = webdriver.Edge()
driver.get("https://www.baidu.com/")
driver.maximize_window()  # 确保窗口在前台，避免pyautogui操作失效
time.sleep(2)
driver.find_element(By.XPATH,"//div[@class='right-tools-wrapper']//div[3]//div[1]//div[1]//*[name()='svg']").click()


time.sleep(2)

from pywinauto.keyboard import send_keys
#输入文件绝对路径
send_keys(r"E:\Desktop\1111.jpg")
time.sleep(5)
# 输入回车键
send_keys('{ENTER}')


time.sleep(10)



driver.close()  #关闭窗口的
driver.quit() #关闭浏览器的